import 'package:enter_prise_web/page/main/main_page.dart';
import 'package:enter_prise_web/page/more/more.dart';
import 'package:enter_prise_web/page/settings/settings.dart';
import 'package:enter_prise_web/page/staff/staff.dart';
import 'package:enter_prise_web/page/work/work_page.dart';
import 'package:enter_prise_web/widgets/keepAliveWidget.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class IndexController extends GetxController {
  //这个是web网页里面记录选中数据条数的
  var selectCount = 0.obs;

  var pageController = PageController(initialPage: 0);
  late List<Widget> pageViews;

  var title = "主页".obs;

  var currentIndex = 0.obs;

  bool isShowFilter = false;
  int filterIndex = 1;
  FilterType filterType = FilterType.week;
  var filterText = "过滤".obs;

  @override
  void onInit() {
    super.onInit();
    pageViews = [
      KeepAliveWidget(MainPage()),
      const KeepAliveWidget(Settings()),
      const KeepAliveWidget(Staff()),
      const KeepAliveWidget(WorkPage()),
      const KeepAliveWidget(More()),
    ];
  }

  void showFilterView() {
    isShowFilter = true;
    update(["filterView"]);
  }

  void makeFilterIsNotShow() {
    isShowFilter = false;
    update(["filterView"]);
  }
}
